import { Button } from 'antd'
import React, { useRef, useState } from 'react'

const index = () => {


  const [text,settext] = useState("")

  const inputJson = JSON.stringify({
    cardclass: "guestcard",
    uuid: "12345",
    roomid: "01020300",
    begintime: "2022-06-26 12:31:09",
    endtime: "2022-06-27 12:31:09",
    t1: "1",
    t2: "1",
    t4: "0",
    t5: "0",
    t6: "0",
    t7: "0",
    t8: "0",
    roomlist: "0102050001020400"
  });

  const btn =  async() => {
    console.log(window)
    const result = await window.electronAPI.callNFCDriver(inputJson);
      const data = JSON.parse(result.data);
      console.log(data)
  }


  return (
    <div>

      <Button onClick={btn}>点击</Button>
      File path: <strong >{text}</strong>
    </div>
  )
}

export default index
